//
//  LXExtension+UILabel.swift
//  LXExtensions
//
//  Created by yoctech on 2021/9/16.
//

import Foundation
import UIKit

@objc public extension UILabel {
    @objc convenience init(text:String? = nil, color:UIColor?, font: UIFont) {
        self.init()
        self.text = text
        self.setText(color: color, font: font)
    }
    
    @objc convenience init(text:String? = nil, color:UIColor?, font: UIFont, numberOfLines: Int) {
        self.init()
        self.text = text
        self.setText(color: color, font: font, numberOfLines: numberOfLines)
    }
    
    @objc convenience init(text:String? = nil, color:UIColor?, font: UIFont, numberOfLines: Int, textAlignment: NSTextAlignment) {
        self.init()
        self.text = text
        self.setText(color: color, font: font, numberOfLines: numberOfLines, textAlignment: textAlignment)
    }

    @objc func setText(color: UIColor?, font: UIFont) {
        self.textColor = color
        self.font = font
    }
    
    @objc func setText(color: UIColor?, font: UIFont, numberOfLines: Int) {
        self.textColor = color
        self.font = font
        self.numberOfLines = numberOfLines
    }
    
    @objc func setText(color: UIColor?, font: UIFont, numberOfLines: Int, textAlignment: NSTextAlignment) {
        self.textColor = color
        self.font = font
        self.numberOfLines = numberOfLines
        self.textAlignment = textAlignment
    }
}
